<?php
namespace App\Models;

/**
 * 系统用户登录日志表
 */
class MLoginLog extends BaseModel
{
    public $table = "login_log";

    public static function log(MUser $user)
    {
        $log = new MLoginLog();
        $log->uid = $user->id;
        $log->no = $user->no;
        $log->ip = request()->getClientIp();
        $log->time = time();
        return $log->save();
    }
}